"use strict";
const electron = require("electron");
electron.contextBridge.exposeInMainWorld("ipcRenderer", {
  send: (channel, ...args) => {
    if ((args == null ? void 0 : args.length) > 0) {
      electron.ipcRenderer.send(channel, ...args);
    } else {
      electron.ipcRenderer.send(channel);
    }
  },
  on: (channel, func) => {
    electron.ipcRenderer.on(channel, func);
  },
  once: (channel, func) => {
    electron.ipcRenderer.once(channel, func);
  },
  removeListener: (channel, func) => {
    electron.ipcRenderer.removeListener(channel, func);
  },
  sendSync: (channel, ...args) => {
    if ((args == null ? void 0 : args.length) > 0) {
      return electron.ipcRenderer.sendSync(channel, ...args);
    } else {
      return electron.ipcRenderer.sendSync(channel);
    }
  },
  invoke: (channel, ...args) => {
    try {
      return electron.ipcRenderer.invoke(channel, ...args);
    } catch (error) {
      console.error(`Error invoking API: ${channel}`, error);
    }
  }
});
